<?php
class helper_menu_level
{
	private $master_menu = NULL;
	private $agent_menu = NULL;
	
	/**
	 * 
	 * Enter description here ...
	 * @param int|等级ID $typeId
	 * @param int|栏目ID
	 */
	static function _get_UserMenu($typeId,$id = NULL)
	{
		$menu = array();
		switch ($typeId)
		{
			case 33: //用户
				$menu = array(
							1=>array(
									'title'=>'充值及话单',
									'submenu'=>array(
													'充值记录'=>'card/log',
													'储值卡充值开户'=>'card/pay',
													'通话详单' => ('cdr/histroy'),
													//'短信记录' =>'cdr/smsmsg',
													//'坐席话单' =>'cdr/crmhistroy'
												)
									),
							8=>array(
									'title'=>'当前账户',
									'submenu'=>array(
													'号码绑定' => ('login/bindtel'),
													'网页呼叫' => ('web/caller'),
													'密码修改' => 'login/changepwd',
													'退出系统' =>'login/loginout',
													'VIP开通' =>'users/vip',
													'主叫绑定' =>'users/insertauth',
													'月卡记录'=>'card/monthlog',
													'vip记录'=>'card/viplog'
												)
									),
							10=>array(
									'title'=>'推广员系统',
									'submenu'=>array(
											
											'奖励日志'=>'union/log',
											'我的推广'=>'union/view'
									)
										
							),
							11=>array(
								'title'=>'在线充值',
								'submenu'=>array(
									'在线购卡'=>'acctproducts/userpay'
								)
							),
							12=>array(
								'title'=>'web800',
								'submenu'=>array(
										'800设置'=>'web/web800set'
								)
							),
							13=>array(
								'title'=>'回拨快号',
								'submenu'=>array(
									'快号绑定'=>'cbquick/index'
								)
							)
										
				);
				break;
			case 0: //超管
				$menu = array(
							1=>array(
									'title'=>'代理及用户',
									'submenu'=>array(
													'流量代理管理' => ('agent/index'),
													//'面值代理管理' => array(url('default::default/MzCardManage'),'url'),
													'用户管理' => ('users/index'),
													//'增值服务设置'=>('agent/agentlottery'),
													//'增值服务记录 (用户)'=>('agent/lotterylog'),
													//'增值服务记录 (代理)'=>('agent/agentlotterylog'),
													'清理用户'=>array('system/cleanuser','dialog'),
												)
									),
							2=>array(
									'title'=>'中继路由',
									'submenu'=>array(
													'中继管理' => ('trunk/manage'),
													'呼出路由组' => ('trunk_group/index'),
													'呼入路由'=>'inboundroute/index',
													'对入话务接管理'=>'trunkbill/index',
													'主叫号码池'=>'callergroup/index',
													'回拨快捷拨号'=>'speeddial/index',
													'亲情号码'=>'btobtel/index'
												)
									),
							3=>array(
									'title'=>'费率管理',
									'submenu'=>array(
													//'用户、代理费率' => url('rate/users'),
													'用户、代理费率' => ('rate/agent'),
													//'用户套餐' => url('rate/package'),
													//'代理套餐' => ('agentpackage/index'),
													//'用户套餐' =>'userpackage/index'
												)
									),
							4=>array(
									'title'=>'呼叫中心',
									'submenu'=>array(
												'群呼电话本'=>'callergroup/index',
												'IVR-语音-传真文件管理'=>'bindexten/ivr',
												'分机管理' => 'bindexten/list',
												'队列管理 '=>'bindexten/usergroup',
												'传真管理 '=>'faxrev/index',
												'外呼任务' =>'outcall/index'
												)
							
							),
							5=>array(
									'title'=>'商家管理',
									'submenu'=>array(
												'进入商户卡管理系统'=>array(url('default::default/MzCardManage'),'url'),
// 												'用户充值'=>'card/pay',
 												'流量卡管理'=>'card/agentindex',
 												'代理充值'=>'card/timepay',
// 												'转账'=>'card/transfer',
// 												'转账费率'=>'agent/transfer',
 												'充值记录'=>'card/log',
 												'月卡记录'=>'card/monthlog',
// 												//'vip记录'=>'card/viplog'
												)
							
							),
							6=>array(
									'title'=>'话单报表',
									'submenu'=>array(
													//'用户、代理费率' => url('rate/users'),
													'通话详单' => ('cdr/histroy'),
													'用户消费统计'=>('cdr/userfees'),
													//'消费查询' => 'cdr/costhistroy',
													//'短信记录' =>'cdr/smsmsg',
													'流量利润报表' =>'cdr/listcost',
													//'坐席话单' =>'cdr/crmhistroy'
													'VIP扣费记录'=>'system/vipmoneylog',
													'沉淀核算'=>'agent/deposit'
												)
									),		
							7=>array(
									'title'=>'系统选项',
									'submenu'=>array(
													//'用户、代理费率' => url('rate/users'),
													'系统公告' => ('newsconfig/index'),
													'线路监控' => ('system/calllist'),
													'操作日志' => 'system/log',
													'全国手机号段' =>'system/partcode',
													'SIP在线列表' =>'system/siponline',
													'数据备份' =>'system/databak',
							                        '淘宝领卡日志'=>'system/taobaolog',
							                        '号码过滤'=>'system/filtercall',
							                        '系统分流'=>'system/serverhost',
							                        '呼叫接口日志'=>'system/webcalllog',
													'每日呼叫接口排行'=>'system/calltop',
												)
									),
							8=>array(
									'title'=>'当前账户',
									'submenu'=>array(
													//'用户、代理费率' => url('rate/users'),
													'网页呼叫' => ('web/caller'),
													'电话会议' => ('web/groupcaller'),
													'密码修改' => 'login/changepwd',
													'退出系统' =>'login/loginout'
												)
									),
							9=>array(
								'title'=>'短信系统',
								'submenu'=>array(
										'内容审核'=>'sms/apply',
										'扣费日志'=>'sms/log'
								)
							
							),
							10=>array(
									'title'=>'推广员系统',
									'submenu'=>array(
											'奖励设置'=>'union/index',
											'奖励日志'=>'union/log'
									)
										
							),
							11=>array(
									'title'=>'产品发布',
									'submenu'=>array(
										'产品编辑'=>'acctproducts/index'
									)
							),
							12=>array(
									'title'=>'手机配置',
									'submenu'=>array(
										'手机配置'=>array(url('default::default/MzCardManage'),'url'),
										'免费注册配置'=>array('agent/wapset','dialog'),
										'新闻发布'=>array('agent/newsindex','navTab'),
										'积分记录'=>array('agent/scorelist','navTab')
									)),
							13=>array(
									'title'=>'淘宝充值',
									'submenu'=>array(
										'99系统'=>array('web/taobao88','dialog'),
										//'11系统'=>array('web/taobao11','dialog'),
										
									)),
							14=>array(
									'title'=>'用户套餐',
									'submenu'=>array(
										'用户套餐'=>array('userpackage/index','navTab'),
										'套餐扣费记录'=>array('userpackage/log','navTab'),
										'用户套餐信息'=>array('userpackage/userinfo','navTab')
										
									))
									
															
										
				);
			break;
			case 2: //超管
				$menu = array(
							1=>array(
									'title'=>'代理及用户',
									'submenu'=>array(
													'流量代理管理' => ('agent/index'),
													//'面值代理管理' => array(url('default::default/MzCardManage'),'url'),
													'用户管理' => ('users/index'),
													//'增值服务设置'=>('agent/agentlottery'),
													//'增值服务记录(用户)'=>('agent/lotterylog'),
													//'增值服务记录 (代理)'=>('agent/agentlotterylog'),
													'清理用户'=>array('system/cleanuser','dialog'),
												)
									),
						
							2=>array(
									'title'=>'费率管理',
									'submenu'=>array(
													//'用户、代理费率' => url('rate/users'),
													'用户、代理费率' => ('rate/agent'),
													//'用户套餐' => url('rate/package'),
													//'用户套餐' => ('userpackage/index')
												)
									),		
							5=>array(
									'title'=>'储值卡',
									'submenu'=>array(
												'进入商户卡管理系统'=>array(url('default::default/MzCardManage'),'url'),
												//'vip记录'=>'card/viplog'
												'代理卡管理'=>'card/agentindex',
												'充值记录'=>'card/log',
												'月卡记录'=>'card/monthlog',
												)
							
							),	
							6=>array(
									'title'=>'话单报表',
									'submenu'=>array(
													//'用户、代理费率' => url('rate/users'),
													'通话详单' => ('cdr/histroy'),
													'用户消费统计'=>('cdr/userfees'),
													//'消费查询' => 'cdr/costhistroy',
													//'短信记录' =>'cdr/smsmsg',
													'流量利润报表' =>'cdr/listcost',
													//'坐席话单' =>'cdr/crmhistroy'
													'VIP扣费记录'=>'system/vipmoneylog',
													'沉淀核算'=>'agent/deposit'
												)
									),
							7=>array(
									'title'=>'系统选项',
									'submenu'=>array(
													//'用户、代理费率' => url('rate/users'),
													//'线路监控' => ('system/calllist'),
													'操作日志' => 'system/log',
													
												)
									),
							8=>array(
									'title'=>'当前账户',
									'submenu'=>array(
													//'用户、代理费率' => url('rate/users'),
													'网页呼叫' => ('web/caller'),
													'电话会议' => ('web/groupcaller'),
													'密码修改' => 'login/changepwd',
													'退出系统' =>'login/loginout'
												)
									),
							9=>array(
								'title'=>'短信系统',
								'submenu'=>array(
										'扣费日志'=>'sms/log',
										'内容审核'=>'sms/apply'
											)
								),
							10=>array(
									'title'=>'推广员系统',
									'submenu'=>array(
											'奖励设置'=>'union/index',
									)
										
							),
							11=>array(
									'title'=>'产品发布',
									'submenu'=>array(
										'产品编辑'=>'acctproducts/index'
									)
							),
							12=>array(
									'title'=>'手机配置',
									'submenu'=>array(
										'免费注册配置'=>array('agent/wapset','dialog'),
										//'新闻发布'=>array('agent/newsindex','navtab'),
										'积分记录'=>array('agent/scorelist','navtab')
									),
									
							),
							13=>array(
									'title'=>'淘宝充值',
									'submenu'=>array(
										'99系统'=>array('web/taobao88','dialog'),
										//'11系统'=>array('web/taobao11','dialog'),
										
									)),
// 							14=>array(
// 									'title'=>'用户套餐',
// 									'submenu'=>array(
// 										'用户套餐'=>array('userpackage/index','navTab'),
// 										'套餐扣费记录'=>array('userpackage/log','navTab'),
// 										'用户套餐信息'=>array('userpackage/userinfo','navTab')
										
// 									))
				);
			break;
		}
		if($typeId < 2){
		    $initgame = Helper_Common::getPublicSet('gamecenter_init', 0);
		    if($initgame == 'ok')
		    {
		        if($typeId == 0)
		        {
		            $menu[21] = array(
		                'title'=>'游戏设置',
		                'submenu'=>array(
		                    '用户兑换记录'=>array('gamecenter/userlog'),
		                    '兑换设置'=>array('gamecenter/set'),
		                    '全部代理设置'=>array('gamecenter/index')
		                )
		            
		            );
		        }else{
		            $menu[21] = array(
		                'title'=>'游戏设置',
		                'submenu'=>array(
		                    '用户兑换记录'=>array('gamecenter/userlog'),
		                    '兑换设置'=>array('gamecenter/set'),
		                )
		            
		            );
		        }
		        
		    }
		}
		
		if (is_null($id))
		{
			return $menu;
		}else if (intval($id) == 0)
		{
			return $menu;
		}else if (!isset($menu[$id]))
		{
			return null;
		}else {
			return $menu[$id];
		}
		
	}
	
}

?>